import request from '@/utils/request'

// 获取聊天用户列表
export function getChatUserList(nickName) {
  return request({
    url: '/system/chat/userList',
    method: 'get',
    params: {
      nickName
    }
  })
}

// 获取聊天历史记录
export function getChatHistory(userId, serviceId) {
  return request({
    url: '/system/chat/history',
    method: 'get',
    params: {
      userId,
      serviceId
    }
  })
}

// 发送聊天消息
export function sendChatMessage(data) {
  return request({
    url: '/system/chat/send',
    method: 'post',
    data: data
  })
}

// 标记消息为已读
export function markAsRead(userId, serviceId) {
  return request({
    url: '/system/chat/read',
    method: 'put',
    params: {
      userId,
      serviceId
    }
  })
}

// 获取未读消息数量
export function getUnreadCount() {
  return request({
    url: '/system/chat/unreadCount',
    method: 'get'
  })
}

// 获取快捷回复列表
export function getQuickReplies() {
  return request({
    url: '/system/chat/quickReplies',
    method: 'get'
  })
}

// 上传聊天图片
export function uploadChatImage(data) {
  return request({
    url: '/system/chat/uploadImage',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
} 